#ifndef TCPCLIENT_H
#define TCPCLIENT_H

#include <QWidget>
#include <QTcpSocket>
#include <QtNetwork>
#include <iostream>

using namespace std;

namespace Ui {
class tcpclient;
}

class tcpclient : public QWidget
{
    Q_OBJECT

public:
    explicit tcpclient(QWidget *parent = nullptr);
    ~tcpclient();

    void SetSock(string ipaddr = "127.0.0.1", int port = 8086);

    QString qstr;
    QString s_ipaddr;
    qint16 s_port;

private:
    Ui::tcpclient *ui;

    QTcpSocket *tcpSocket;

signals:
    void sendsignal();
    void connectsuccess();

public slots:
    void on_pushButton_Connect_clicked();
    void on_pushButton_Send_clicked();
    void on_pushButton_Close_clicked();
};

#endif // TCPCLIENT_H
